package com.repair.security;

import java.util.Arrays;
import java.util.List;

public class SecurityConstants {
    // 角色定义
    public static final String ROLE_USER = "ROLE_USER";
    public static final String ROLE_REPAIRMAN = "ROLE_REPAIRMAN";
    public static final String ROLE_ADMIN = "ROLE_ADMIN";

    // 公共资源路径
    public static final List<String> PUBLIC_PATHS = Arrays.asList(
            // 静态资源
            "/",
            "/css/**",
            "/js/**",
            "/images/**",
            "/fonts/**",
            "/favicon.ico",
            "/error",
            "/error/**",
            "/actuator/health",
            "/static/**",

            // 公共页面
            "/home",
            "/login",
            "/login.html",
            "/register",
            "/register.html",
            "/admin-login",
            "/forgot-password",
            "/reset-password",
            "/orders.html",
            "/orders",
            "/profile",
            "/repairman",
            "/repairman.html",
            "/profile.html",
            "/repairman/orders",
            "/repairman/profile",
            "/admin-dashboard",
            "/announcement/**",
            "/announcements",
            "/repairman-announcements",
            "/forum",

            // 公共API
            "/api/auth/**",
            "/api/user/register",
            "/api/user/login",
            "/api/repairman/login",
            "/api/admin/login"
    );

    // 用户权限路径
    public static final List<String> USER_PATHS = Arrays.asList(
            // 用户页面
            "/profile",
            "/profile/**",
            "/index",
            "/index.html",
            "/orders",
            "/orders/**",
            "/order-detail",
            "/order-detail/**",
            "/user-profile",
            "/user-profile/**",
            "/announcement/**",
            "/announcements",
            "/forum",

            // 用户API
            "/api/user/profile",
            "/api/user/profile/**",
            "/api/user/orders",
            "/api/user/orders/**",
            "/api/orders",
            "/api/orders/**",
            "/api/order/**",
            "/api/announcements/**"
    );

    // 维修工权限路径
    public static final List<String> REPAIRMAN_PATHS = Arrays.asList(
            // 维修工页面
            "/repairman",
            "/repairman/**",
            "/repairman-dashboard",
            "/repairman-profile",
            "/repairman-orders",
            "/announcement/**",
            "/repairman-announcements",
            "/forum",

            // 维修工API
            "/api/repairman/profile",
            "/api/order/nearby",
            "/api/repairman/profile/**",
            "/api/repairman/orders",
            "/api/repairman/orders/**",
            "/api/repair-track",
            "/api/repair-track/**",
            "/api/repairman/location",
            "/api/repairman/location/**",
            "/api/order/**",
            "/api/announcements/**",
            "/api/forum/**"
    );

    // 管理员权限路径
    public static final List<String> ADMIN_PATHS = Arrays.asList(
            // 管理员页面
            "/admin",
            "/admin/**",
            "/admin-dashboard",
            "/admin-users",
            "/admin-orders",
            "/admin-repairmen",

            // 管理员API
            "/api/admin",
            "/api/admin/**",
            "/api/forum/**"
    );
} 